package Cani;
//goleste cana 2 in cana 1
public class T21 extends Operator{
	public boolean condition(Nod n){
		if((n.getX()<getMaxCapacityC1())&&(n.getY()>0))
			return true;
		else return false;
	}
	public int min(int a,int b){
		int min=a;
		if(min>b)
			min=b;
		return min;
	}
	public Nod action(Nod n){
		Nod clone=new Nod(n);
		clone.setX(n.x+min(getMaxCapacityC1()-n.x,n.y));
		clone.setY(n.y-min(getMaxCapacityC1()-n.x,n.y));
		return clone;
	}
}